package com.peas.platform.module.icims.base.sys.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 附件记录
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_attachment`")
public class AttachmentPo extends BasePo {

    // 系统
    @Comment(value = "系统")
    @Size(max = 100, message = "系统不能超过100个字符")
    @TableField(value = "`system`", jdbcType = JdbcType.VARCHAR)
    private String system;

    // 系统名称
    @Comment(value = "系统名称")
    @Size(max = 100, message = "系统名称不能超过100个字符")
    @TableField(value = "`system_name`", jdbcType = JdbcType.VARCHAR)
    private String systemName;

    // 服务
    @Comment(value = "服务")
    @Size(max = 100, message = "服务不能超过100个字符")
    @TableField(value = "`service`", jdbcType = JdbcType.VARCHAR)
    private String service;

    // 服务名
    @Comment(value = "服务名")
    @Size(max = 100, message = "服务名不能超过100个字符")
    @TableField(value = "`service_name`", jdbcType = JdbcType.VARCHAR)
    private String serviceName;

    // 文件类型
    // 字典取值:FileType
    @Comment(value = "文件类型", dictType = "FileType")
    @Size(max = 20, message = "文件类型不能超过20个字符")
    @TableField(value = "`file_type`", jdbcType = JdbcType.VARCHAR)
    private String fileType;

    // 附件存储名称
    // 以MD5值重新命名
    @Comment(value = "附件存储名称")
    @Size(max = 200, message = "附件存储名称不能超过200个字符")
    @TableField(value = "`file_name`", jdbcType = JdbcType.VARCHAR)
    private String fileName;

    // 附件MD5值
    @Comment(value = "附件MD5值")
    @Size(max = 50, message = "附件MD5值不能超过50个字符")
    @TableField(value = "`md5`", jdbcType = JdbcType.VARCHAR)
    private String md5;

    // 附件大小(字节)
    @Comment(value = "附件大小(字节)")
    @TableField(value = "`size`", jdbcType = JdbcType.BIGINT)
    private Long size;

    // 附件上传人
    // 【用户表】
    @Comment(value = "附件上传人")
    @TableField(value = "`uploader`", jdbcType = JdbcType.BIGINT)
    private Long uploader;

    // 附件存储方式
    // local本地存储，minio，oss
    @Comment(value = "附件存储方式")
    @Size(max = 20, message = "附件存储方式不能超过20个字符")
    @TableField(value = "`storage`", jdbcType = JdbcType.VARCHAR)
    private String storage;

    // 附件存储桶
    @Comment(value = "附件存储桶")
    @Size(max = 100, message = "附件存储桶不能超过100个字符")
    @TableField(value = "`bucket`", jdbcType = JdbcType.VARCHAR)
    private String bucket;

    // 存储路径
    @Comment(value = "存储路径")
    @Size(max = 200, message = "存储路径不能超过200个字符")
    @TableField(value = "`path`", jdbcType = JdbcType.VARCHAR)
    private String path;

    // 原始文件名
    @Comment(value = "原始文件名")
    @Size(max = 200, message = "原始文件名不能超过200个字符")
    @TableField(value = "`original`", jdbcType = JdbcType.VARCHAR)
    private String original;

    // 附件URL
    @Comment(value = "附件URL")
    @Size(max = 500, message = "附件URL不能超过500个字符")
    @TableField(value = "`url`", jdbcType = JdbcType.VARCHAR)
    private String url;

}
